<template>
	<view :class="['vh100',{'dark':theme == 'dark'}]">
		<view class="plr10 ptb10">
			<view class="ptb15 ft14 flex alcenter between plr10 bdb_blue3" v-for="(item,index) in list" :key='index'>
				<span>{{item.createTime}}</span>
				<!-- 当前版 不需要写参数对接默认这个介绍名称即可，版本号对接后台的版本参数。后台写什么，这个页面的版本都会跟着改变 -->
				<span class="flex alcenter">{{item.price+item.coin}}</span>
				<!-- 加后台参数 -->
			</view>
			<u-loadmore :status="status" :load-text="loadText" />
		</view>
	</view>
	
</template>

<script>
	import {mapState,mapActions,mapGetters} from 'vuex';
	import uniLoadMore from "../../components/uni-load-more.vue"
	import {freeTransferForWalletLog} from '../../common/apiString.js'
	import {myMixins} from '@/common/myMixins.js'
	export default{
		mixins:[myMixins],
		data(){
			return{
				list:[],
				loadText: {
					loadmore: this.$t('bico.W696'),
					loading: this.$t('bico.W697'),
					nomore: this.$t('bico.W698')
				},
				status:'loadmore',
				page:1,
				more:this.$t('home').up,
				show:true
			}
		},
		components: {
			uniLoadMore
		},
		computed:{
			...mapState({
			  theme:state=>state.theme
			}),
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title:this.$t('bico.W552'),
			})
			this.$utils.setTheme(this.theme);
			this.getList();
		},
		methods: {
			getList() {
				var that = this;
				// uni.showLoading();
				this.$utils.initDataToken({url:freeTransferForWalletLog,data:{current:this.page},type:'post'},(res,msg)=>{
					// uni.hideLoading();
					if(that.page == 1){
						if(res.records && res.records.length<=res.total){
							that.show = false;
						}
					}
					that.list = that.list.concat(res.records);
					if(res.list && res.list.length>0){
						that.more = that.$t('home').up;
						that.show = true;
					}else{
						that.more = that.$t('home').nomore
					}
					this.status = 'nomore'
				})
			}
		},
		onReachBottom() {
			this.status = 'loading'
			this.page ++;
			this.getList();
		}
	}
</script>

<style scoped>
	
	.ft14 {
	    font-size: 4vw;
	}
	
</style>
